package com.itheima.chapter10.theadPool;
//有上限的线程池
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo2 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName()+"在执行");
        });
        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName()+"在执行");
        });
        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName()+"在执行");
        });
        executorService.shutdown();
    }
}
